package com.epfly.promo.activity.dao;

import com.epfly.promo.activity.entity.ActivityActiveStoreEntity;
import org.apache.ibatis.annotations.*;
import tk.mybatis.mapper.additional.insert.InsertListMapper;
import tk.mybatis.mapper.common.BaseMapper;

import java.util.List;

@Mapper
public interface ActivityActiveStoredMapper extends BaseMapper<ActivityActiveStoreEntity>, InsertListMapper<ActivityActiveStoreEntity> {


    @Delete(value = "delete from tbl_activity_active_store where activity_id = #{activityId}")
    int deleteByActivityId(@Param(value = "activityId") Long activityId);

    @ResultType(value = Long.class)
    @Select(value = "select activity_id from tbl_activity_active_store where merchant_id = #{merchantId} and store_id in (#{storeId}, #{unLimit})")
    List<Long> findByMerchantIdAndStoreId(@Param(value = "merchantId") String merchantId, @Param(value = "storeId") String storeId, @Param(value = "unLimit") String unLimit);
}
